import request from "@/utils/request";

// 获取自然拼读列表
export function getNaturalSpellList(type) {
  return request({
    url: `/naturalSpell/findAllByType/${type}`,
    method: "get",
  });
}

// 获取单元
export function groupUnit(bookId) {
  return request({
    url: `/word/groupUnit?bookId=${bookId}`,
    method: "get",
  });
}

// 通过单词获取题目
export function create(data) {
  return request({
    url: "/naturalSpell/create",
    method: "post",
    data,
  });
}

// 获取自然拼读列表
export function getNaturalSpellVideo(params) {
  return request({
    url: "naturalSpell/getVideoList",
    method: "get",
    params,
  });
}
// 获取自然拼读单词
export function getNaturalSpellWord(params) {
  return request({
    url: "/naturalSpell/getWordList",
    method: "get",
    params,
  });
}

// 新录音校验
export function postNewSpellVoice(data) {
  return request({
    url: "/naturalSpell/spellNewEvaluation",
    method: "post",
    data,
  });
}

// 录音校验
export function postSpellVoice(data) {
  return request({
    url: "/naturalSpell/spellEvaluation",
    method: "post",
    data,
  });
}
// /naturalSpellQuestion/getTestQuestionList?elementId=33
// 获取闯关测试题目
export function getSpellQuestion(params) {
  return request({
    url: "/naturalSpellQuestion/getTestQuestionList",
    method: "get",
    params,
  });
}
// 音频题校验
export function postTestSpellVoice(data) {
  return request({
    url: "/naturalSpellQuestion/efficacyFrequencyAnswer",
    method: "post",
    data,
  });
}
// 闯关普通题校验
export function postTestQuestion(data) {
  return request({
    url: "/naturalSpellQuestion/efficacyAnswer",
    method: "post",
    data,
  });
}
// 记录学习进度
export function postStudyStep(params) {
  return request({
    url: "/spellStudentStudyStep/addSpellStudentStudyStep",
    method: "get",
    params,
  });
}

// 获取未读单词id
export function getWordUnit(params) {
  return request({
    url: "/naturalSpell/getWordUnit",
    method: "get",
    params,
  });
}

// 见词能读
export function getReadWordList(params) {
  return request({
    url: "/naturalSpell/getReadWordList",
    method: "get",
    params,
  });
}

// 认识不认识
export function updateWordStrange(params) {
  return request({
    url: "/naturalSpell/updateWordStrange",
    method: "get",
    params,
  });
}

// 听音能写
export function getDictationWordList(params) {
  return request({
    url: "/naturalSpell/getDictationWordList",
    method: "get",
    params,
  });
}
